/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "plano_conta_ref_sped")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PlanoContaRefSped.findAll", query = "SELECT p FROM PlanoContaRefSped p")})
public class PlanoContaRefSped implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(name = "COD_CTA_REF", length = 30)
    private String codCtaRef;
    @Column(length = 100)
    private String descricao;
    @Lob
    @Column(length = 65535)
    private String orientacoes;
    @Column(name = "INICIO_VALIDADE")
    @Temporal(TemporalType.DATE)
    private Date inicioValidade;
    @Column(name = "FIM_VALIDADE")
    @Temporal(TemporalType.DATE)
    private Date fimValidade;
    private Character tipo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPlanoContaRefSped")
    private List<ContabilConta> contabilContaList;

    public PlanoContaRefSped() {
    }

    public PlanoContaRefSped(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCodCtaRef() {
        return codCtaRef;
    }

    public void setCodCtaRef(String codCtaRef) {
        this.codCtaRef = codCtaRef;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getOrientacoes() {
        return orientacoes;
    }

    public void setOrientacoes(String orientacoes) {
        this.orientacoes = orientacoes;
    }

    public Date getInicioValidade() {
        return inicioValidade;
    }

    public void setInicioValidade(Date inicioValidade) {
        this.inicioValidade = inicioValidade;
    }

    public Date getFimValidade() {
        return fimValidade;
    }

    public void setFimValidade(Date fimValidade) {
        this.fimValidade = fimValidade;
    }

    public Character getTipo() {
        return tipo;
    }

    public void setTipo(Character tipo) {
        this.tipo = tipo;
    }

    @XmlTransient
    public List<ContabilConta> getContabilContaList() {
        return contabilContaList;
    }

    public void setContabilContaList(List<ContabilConta> contabilContaList) {
        this.contabilContaList = contabilContaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PlanoContaRefSped)) {
            return false;
        }
        PlanoContaRefSped other = (PlanoContaRefSped) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.PlanoContaRefSped[ id=" + id + " ]";
    }
    
}
